main_m1g_t1_sc <- glm(as.formula(paste("cw_event_g", paste(c(m1g_t1, group_nat_vars, group_unit_vars, unit_vars, nat_vars, "as.factor(region)","as.factor(year)","cw_event_g_peaceyears_l1","I(cw_event_g_peaceyears_l1^2)","I(cw_event_g_peaceyears_l1^3)","cw_event_any_slag_l1"), collapse = " + "), sep = " ~ ")), family=binomial(link="logit"),control = list(maxit = 50), data=subset(main_group, subset_analysis == 1 & int_grp_rel_dominant_g == 1))
main_m1g_t1_sc_cse <- data.frame(cluster.se(main_m1g_t1_sc, as.factor(subset(main_group, subset_analysis == 1 & int_grp_rel_dominant_g == 1)$cowcode))[,2])
main_m1g_t1_sf <- glm(as.formula(paste("cw_event_g", paste(c(m1g_t1, group_nat_vars, group_unit_vars, unit_vars, nat_vars, "as.factor(region)","as.factor(year)","cw_event_g_peaceyears_l1","I(cw_event_g_peaceyears_l1^2)","I(cw_event_g_peaceyears_l1^3)","cw_event_any_slag_l1"), collapse = " + "), sep = " ~ ")), family=binomial(link="logit"),control = list(maxit = 50), data=subset(main_group, subset_analysis == 1 & int_grp_rel_dominant_g == 0))
main_m1g_t1_sf_cse <- data.frame(cluster.se(main_m1g_t1_sf, as.factor(subset(main_group, subset_analysis == 1 & int_grp_rel_dominant_g == 0)$cowcode))[,2])
main_m1d_t1_sb <- glm(as.formula(paste("cv_event", paste(c(m1d_t1, dyad_nat_vars, dyad_unit_vars, unit_vars, nat_vars,"as.factor(region)","as.factor(year)","cv_event_peaceyears_l1","I(cv_event_peaceyears_l1^2)","I(cv_event_peaceyears_l1^3)","cv_event_any_slag_l1"), collapse = " + "), sep = " ~ ")), family=binomial(link="logit"),control = list(maxit = 50), data=subset(main_dyad, subset_analysis == 1 & int_grp_rel_dominant == 1))
main_m1d_t1_sb_cse <- data.frame(cluster.se(main_m1d_t1_sb, as.factor(subset(main_dyad,  int_grp_rel_dominant == 1 & subset_analysis == 1)$cowcode))[, 2])
main_m2d_t1_sb <- glm(as.formula(paste("cv_event", paste(c(m2d_t1, dyad_nat_vars, dyad_unit_vars, unit_vars, nat_vars,"as.factor(region)","as.factor(year)","cv_event_peaceyears_l1","I(cv_event_peaceyears_l1^2)","I(cv_event_peaceyears_l1^3)","cv_event_any_slag_l1"), collapse = " + "), sep = " ~ ")), family=binomial(link="logit"),control = list(maxit = 50), data=subset(main_dyad, subset_analysis == 1 & int_grp_rel_dominant == 1))
main_m2d_t1_sb_cse <- data.frame(cluster.se(main_m2d_t1_sb, as.factor(subset(main_dyad, int_grp_rel_dominant == 1 & subset_analysis == 1)$cowcode))[, 2])
stargazer(main_m1g_t1_sc, main_m1g_t1_sf, main_m1d_t1_sb, main_m2d_t1_sb, se=c(main_m1g_t1_sc_cse, main_m1g_t1_sf_cse, main_m1d_t1_sb_cse, main_m2d_t1_sb_cse), dep.var.labels.include = T, dep.var.labels = c("Civil violence (group)","Communal violence","Communal violence"), column.labels = c("Maj.", "Min.","Maj./min. dyad","Maj./min. dyad"), omit=c("cowcode|region|factor|size|int_grp_rel|reverse_dyad|ladm|admin_rugged|oil_area|ldistance|lgdppc|lpop|politya|fractionalization|election|years|slag|intercept|constant"), type="text", order=vars.order_gd, title="Table 1. Territorial autonomy and civil/communal violence incidence.", style = "apsr", star.cutoffs = c(.1, .05, .01, .001), star.char = c("†", "*", "**","***"), notes = c("† p<0.1; * p<0.05; ** p<0.01; *** p<0.001; country-clustered SE's in parentheses; constant, group-/dyad-, country-,", "unit-level controls, and cubic terms for group-/dyad-wise peace years included but not reported; maj. = second-", "order majority; min. = second-order minority. The dependent variable is a binary variable equal to one if there is", "at least one instance of civil/communal violence involving a group/dyad in a given unit. For full results see table", "A5 in appendix 2."), notes.append=FALSE, covariate.labels = c("Territorial autonomy","Territorial autonomy x included/excluded","Included","Included/excluded","Excluded/excluded"), out="../tables/table1.txt")
stargazer(main_m1g_t1_sc, main_m1g_t1_sf, main_m1d_t1_sb, main_m2d_t1_sb, se=c(main_m1g_t1_sc_cse, main_m1g_t1_sf_cse, main_m1d_t1_sb_cse, main_m2d_t1_sb_cse), dep.var.labels.include = T, dep.var.labels = c("Civil violence (group)","Communal violence","Communal violence"), column.labels = c("Maj.", "Min.","Maj./min. dyad","Maj./min. dyad"), omit=c("cowcode|region|factor"), type="text", order=vars.order_gd, title="Table A5. Territorial autonomy and civil/communal violence incidence: full results.", style = "apsr", star.cutoffs = c(.1, .05, .01, .001), star.char = c("†", "*", "**","***"), notes = c("† p<0.1; * p<0.05; ** p<0.01; *** p<0.001; country-clustered SE’s in parentheses; maj. = second-order majority; min. = second-order minority.","The dependent variable is a binary variable equal to one if there is at least one instance of civil/communal violence involving a group/dyad in a given unit.","Region- and year-fixed effects included but not reported."), notes.append=FALSE, covariate.labels = c("Territorial autonomy","Territorial autonomy x included/excluded","Included","Included/excluded","Excluded/excluded","Relative size (state)","Relative size (state, mean)","Relative size (state, diff.)","Relative size (unit)","Relative size (unit, mean)","Relative size (unit, diff.)","Asymmetry", "Population (unit, logged)", "Area (unit, logged)", "Avg. ruggedness (unit)", "Oil in unit", "Distance capital (unit, logged)", "Distance border (unit, logged)","GDP pc. (logged)", "Population (state, logged)","Democracy","Ethnic fractionalization","Election year","Civil violence peace years","Civil violence peace years 2","Civil violence peace years 3","Civil violence spatial lag", "Communal violence peace years", "Communal violence peace years 2", "Communal violence peace years 3","Communal violence spatial lag"), out="../tables/tablea5.txt")